/*  1:   */ package org.jetbrains.generate.tostring.template;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.generate.tostring.exception.TemplateResourceException;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */ 
/* 10:   */ public class TemplateResourceLocator
/* 11:   */ {
/* 12:   */   private static final String a = "/org/jetbrains/generate/tostring/template/DefaultConcatMember.vm";
/* 13:   */   private static final String b = "/org/jetbrains/generate/tostring/template/DefaultConcatMemberGroovy.vm";
/* 14:   */   private static final String c = "/org/jetbrains/generate/tostring/template/DefaultConcatMemberSuper.vm";
/* 15:   */   private static final String d = "/org/jetbrains/generate/tostring/template/DefaultBuffer.vm";
/* 16:   */   private static final String e = "/org/jetbrains/generate/tostring/template/DefaultBuilder.vm";
/* 17:   */   private static final String f = "/org/jetbrains/generate/tostring/template/DefaultToStringBuilder.vm";
/* 18:   */   private static final String g = "/org/jetbrains/generate/tostring/template/DefaultToStringBuilder3.vm";
/* 19:   */   private static final String h = "/org/jetbrains/generate/tostring/template/DefaultGuava.vm";
/* 20:   */   
/* 21:   */   public static TemplateResource[] getDefaultTemplates()
/* 22:   */   {
/* 23:   */     try
/* 24:   */     {
/* 25:47 */       return new TemplateResource[] { new TemplateResource("String concat (+)", a("/org/jetbrains/generate/tostring/template/DefaultConcatMember.vm"), true), new TemplateResource("String concat (+) and super.toString()", a("/org/jetbrains/generate/tostring/template/DefaultConcatMemberSuper.vm"), true), new TemplateResource("StringBuffer", a("/org/jetbrains/generate/tostring/template/DefaultBuffer.vm"), true), new TemplateResource("StringBuilder (JDK 1.5)", a("/org/jetbrains/generate/tostring/template/DefaultBuilder.vm"), true), new TemplateResource("ToStringBuilder (Apache commons-lang)", a("/org/jetbrains/generate/tostring/template/DefaultToStringBuilder.vm"), true), new TemplateResource("ToStringBuilder (Apache commons-lang 3)", a("/org/jetbrains/generate/tostring/template/DefaultToStringBuilder3.vm"), true), new TemplateResource("Objects.toStringHelper (Guava)", a("/org/jetbrains/generate/tostring/template/DefaultGuava.vm"), true), new TemplateResource("Groovy: String concat (+)", a("/org/jetbrains/generate/tostring/template/DefaultConcatMemberGroovy.vm"), true) };
/* 26:   */     }
/* 27:   */     catch (IOException localIOException)
/* 28:   */     {
/* 29:59 */       throw new TemplateResourceException("Error loading default templates", localIOException);
/* 30:   */     }
/* 31:   */   }
/* 32:   */   
/* 33:   */   private static String a(String paramString)
/* 34:   */     throws IOException
/* 35:   */   {
/* 36:72 */     BufferedInputStream localBufferedInputStream = new BufferedInputStream(TemplateResourceLocator.class.getResourceAsStream(paramString));
/* 37:73 */     return StringUtil.convertLineSeparators(FileUtil.loadTextAndClose(new InputStreamReader(localBufferedInputStream, "UTF-8")));
/* 38:   */   }
/* 39:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.generate.tostring.template.TemplateResourceLocator

 * JD-Core Version:    0.7.0.1

 */